<template>
	<view class="setting-container">
		<u-navbar bgColor="#000000" autoBack height="90" placeholder fixed>
			<view class="u-nav-slot" slot="center">
				<!-- 正文内容 -->
				<text>设置</text>
			</view>
		</u-navbar>
		<view class="setting-list">
			<navigator v-for="(item,index) in listData" :key="index" :url="item.path">
				<CommonNav :fontSize="30" style="margin-bottom: 40rpx;" iconColor="#ffffff" :name="item.name"
					color="#ffffff"></CommonNav>
			</navigator>
		</view>
		<view class="login-out">
			<u-button type="error" @click="loginOut">退出登录</u-button>
		</view>	
	</view>
</template>

<script>
	import CommonNav from "../../components/CommonNav.vue"
	export default {
		components: {
			CommonNav
		},
		data() {
			return {
				listData: [{
						name: "个人资料",
						path: "/pages/my/user"
					},
					{
						name: "运动与数据",
						path: "/pages/my/health"
					},
					{
						name: "账号与安全"
					},
					{
						name: "申请认证"
					},
					{
						name: "运动设置"
					},
					{
						name: "消息与提醒"
					},
					{
						name: "隐私"
					},
					{
						name: "通用设置"
					},
					{
						name: "关于"
					},
				]
			};
		},
		methods: {
			loginOut(){
				sessionStorage.clear()
				uni.navigateTo({
					url:"/pages/login"
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
	.setting-container {
		height: 100%;
		overflow-y: auto;
		background-color: #000000;
		padding: 0 60rpx;

		.u-nav-slot {
			font-size: 46rpx;
			font-weight: bold;
		}
	}
	.login-out{
		position: fixed;
		bottom: 20rpx;
		width: 700rpx;
		left: 20rpx;
		right:10rpx
	}
</style>
